package com.neuedu.mblog.controller;

import com.neuedu.mblog.entiry.User;
import com.neuedu.mblog.service.CommentService;
import com.neuedu.mblog.service.PostService;
import com.neuedu.mblog.service.UserService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

/**
 * 项目：mblog_java4
 * 创建时间：  2022-01-01   15:39
 * 作者 :jshand
 * 描述 : 用户的主页
 */
@WebServlet(urlPatterns = "/user/comment")
public class UserCommentController extends BaseController {
    private UserService userService = new UserService();
    private CommentService commentService = new CommentService();

    @Override
    protected void list(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException, ClassNotFoundException {
        //用户首页

        userService.postAndCommentNums(request);

        //发表评论的分页
        commentService.pageList(request);


        request.getRequestDispatcher("/WEB-INF/view/front/user/comment.jsp").forward(request,response);

    }



}
